<?
require("config.php");

$show_backnav = "product_menu";
$location_status .= "| Delete";

$menuname = array(
	"Info",
	"Pictures",
	"Color",
	"Size",
	"Specification",
	"Features",
	"Accessories",
	"Packaging",
);

$menutarget = array(
	"delete",
	"delete_pictures",
	"delete_color",
	"delete_size",
	"delete_specification",
	"delete_features",
	"delete_accessories",
	"delete_packaging",
);

$menutype = 2;

if (NULL!=$action){

   $Query = "delete from $table where id=$id Limit 1";

   myQuery($Query);


   header("location:" . $rela_path . "share/msg.php?v=3");

   exit();

}


if (!checkRecord($table,$id)){

	header("location:" . $rela_path . "share/msg.php?v=9002");
  
}


$Query = "select 
item01_features_text, 
item02_features_text, 
item03_features_text, 
item04_features_text, 
item05_features_text, 
item06_features_text, 
item07_features_text, 
item08_features_text, 
item09_features_text, 
item10_features_text,
special_features 
from pro_basic where id=$id Limit 1";
$r = myQuery($Query);

$Item01= $r[0][0];
$Item02= $r[0][1];
$Item03= $r[0][2];
$Item04= $r[0][3];
$Item05= $r[0][4];
$Item06= $r[0][5];
$Item07= $r[0][6];
$Item08= $r[0][7];
$Item09= $r[0][8];
$Item10= $r[0][9];
$Specail_Feature = $r[0][10];

$sFeature = split(",",$Specail_Feature);

require($rela_path . "inc/header.php");

?>

<!--Content Start-->
<form action="" method="post" enctype="multipart/form-data" name="form1">  
<!--hidden filed-->
<input name="id" type="hidden" value="<?print($id)?>">
<input name="action" type="hidden" value="delete">

  <table width="95%" border="0" align="center">
                      <tr> 
                        
      <td>&nbsp; </td>
                      </tr>
                      <tr> 
                        
      <td><p><strong>Are you sure to delete this product ?</strong> 
          <input type="Submit" class="button" name="Button" value="   Yes   ">
          <input type="button" class="button" name="Submit2" value="   No   " onClick="Redirect('product_menu.php',1);">
          <br>
          <br>
          <b><u>Features</u></b> :<br>
        </p>
        <table border="0">
          <tr> 
            <td width="40"><div align="right">1. </div></td>
            <td width="10">&nbsp;</td>
            <td><?print($Item01)?></td>
          </tr>
          <tr> 
            <td><div align="right">2. </div></td>
            <td>&nbsp;</td>
            <td><?print($Item02)?></td>
          </tr>
          <tr> 
            <td><div align="right">3.</div></td>
            <td>&nbsp;</td>
            <td><?print($Item03)?></td>
          </tr>
          <tr> 
            <td><div align="right">4.</div></td>
            <td>&nbsp;</td>
            <td><?print($Item04)?></td>
          </tr>
          <tr> 
            <td><div align="right">5.</div></td>
            <td>&nbsp;</td>
            <td><?print($Item05)?></td>
          </tr>
          <tr> 
            <td><div align="right">6.</div></td>
            <td>&nbsp;</td>
            <td><?print($Item06)?></td>
          </tr>
          <tr> 
            <td><div align="right">7.</div></td>
            <td>&nbsp;</td>
            <td><?print($Item07)?></td>
          </tr>
          <tr> 
            <td><div align="right">8.</div></td>
            <td>&nbsp;</td>
            <td><?print($Item08)?></td>
          </tr>
          <tr> 
            <td><div align="right">9.</div></td>
            <td>&nbsp;</td>
            <td><?print($Item09)?></td>
          </tr>
          <tr> 
            <td><div align="right">10.</div></td>
            <td>&nbsp;</td>
            <td><?print($Item10)?></td>
          </tr>
        </table>
        <b><u><br>
        </u></b><br> <table border="0" cellspacing="1" cellpadding="0">
          <tr> 
            <td><b><u>Special Features</u></b> :</td>
            <td align="right">&nbsp;</td>
          </tr>
        </table>
        <br> 
        <table border="0">
<?
$Query = "SELECT code, name FROM pro_features";
$feature_info = myQuery($Query);

for ($i=0;$i<count($sFeature);$i++) {

	for ($c=0;$c<count($feature_info);$c++){
		if ($sFeature[$i] == $feature_info[$c][0]) $feature_value = $feature_info[$c][1];
	}

?>
          <tr> 
            <td width="40"> <div align="right"><?print($i+1)?>.</div></td>
            <td width="10">&nbsp;</td>
            <td><?print("(" . $sFeature[$i] . ") " . $feature_value)?></td>
          </tr>
          <?}?>
        </table>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p></td>
                      </tr>
                    </table>
                    </form>
            <!--Content End-->
            <?
require($rela_path . "inc/footer.php");
?>
        